package com.cyh.testdesignpattern.command;

//电视开的命令
public class TvOnCommand implements Command {
    TvReceiver tv;


    public TvOnCommand(TvReceiver tv) {
        this.tv = tv;
    }

    @Override
    public void execute() {
        //调用接收者的方法
        tv.on();
    }

    @Override
    public void undo() {
        tv.off();
    }
}
